<?php
    try {
        $date_identifier = date('Ymd');
        $org = file_get_contents('php://input');
        $fileName = 'auth_code_'.$date_identifier.'.txt';
        //var_dump($decryptedStr);
        file_put_contents($fileName, "[ ".date('Y-m-d H:i:s').' ]:'.json_encode($org).PHP_EOL,FILE_APPEND);
        echo json_encode(['result'=>'success']);
        $code = '';
        if($org){
            $orgArr = explode('=',$org);
            if(isset($orgArr[1])){
                $code = $orgArr[1];
            }
        }
        $TplusCommonController = new \App\Http\Controllers\Chanjet\TplusCommonController();
        $TplusCommonController->getTokenByAuthcodeFunc($org);
        //echo "Decrypted string: " . json_encode($decryptedStr);
    } catch (Exception $e) {
        echo "Error: " . $e->getMessage();
    }
?>
